PACK block
Short summary
Name |
|
→POU type |
|
Category |
|
Conform to →IEC-standard |
not defined in IEC-standard |
Graphical interface |
|
Available since |
|
Functionality
The block returns the transferred values of the bytes connected to the inputs IN0
– IN7
. In case of target systems saving data in little →endian format, the byte of input IN0
is transferred to the lowest significant byte of the return value, the byte of input IN7
to the highest significant byte of the return value. A reversed behavior is true for target systems saving data in big endian format.
Special cases (see under "Example for usage within ST-editor"):
-
If the size of the result data type (number of bytes representing the data type) is > than the number of the connected input bytes, the higher significant bytes of the return value remain not-initialized.
In case ofBOOL
values for the return value,TRUE
is returned for each value ≠0
at inputIN0
. -
If more input bytes are connected than the result data type can hold, only the lower significant input bytes are transferred to the return value. In case of target systems saving data in little endian format, these are the inputs positioned in the upper part of the block.
It is possible that the block does not behave as expected when there is a nested usage together with other blocks. This behavior is caused due to the typing using to the lowest common data type (see under "Typing of expressions" for details).
Inputs, return value
|
Identifier |
Description |
|
---|---|---|---|
Inputs: |
|
|
1st value |
|
|
2nd value |
|
... (extensible until) |
|||
|
|
8th value |
|
Return value: |
|
|
|
Input EN
and output ENO
are available when →calling the block. See "Execution control: EN, ENO" for information on input EN
and output ENO
.
See:
-
"Blocks for safe logic" whether this block is supported for developing safety-relevant applications.
-
"Highlighting safe logic in the FBD-editor" for the effects when using the block as a block for safe logic.
Example for usage within ST-editor
The following example is valid for target systems saving data in little endian format. The calculated values are evaluated by using the Assert
block.
|
When creating your application within the ST-editor, enter a call of a block by typing the text as requested by the syntax or use Content Assist.